{{ $display := 1 }}
{{- if .Labels.alertname }}
**告警名称：**{{ .Labels.alertname }}
{{- end }}

{{- if .Annotations.description }}
**描述：**{{ .Annotations.description }}
{{- end }}

{{- if .Labels.instance }}
**Instance：**{{ .Labels.instance }}
{{- end }}

{{- if .Labels.namespace }}
**Namespace：**{{ .Labels.namespace }}
{{- end }}

{{- if .Labels.deployment }}
{{- $display = 0 }}
**Deployment Name：**{{ .Labels.deployment }}
{{- end }}

{{- if .Labels.daemonset }}
{{- $display = 0 }}
**DaemonSet Name：**{{ .Labels.daemonset }}
{{- end }}

{{- if .Labels.statefulset }}
{{- $display = 0 }}
**StatefulSet Name：**{{ .Labels.statefulset }}
{{- end }}

{{- if .Labels.pod }}
{{- if eq $display 1 }} 
**Pod Name：**{{ .Labels.pod }}
{{- end }}
{{- end }}

{{- if .Labels.ingress }}
**Ingress Name：**{{ .Labels.ingress }}
{{- end }}

{{- if .Labels.service }}
**Service Name：**{{ .Labels.service }}
{{- end }}

{{- if .Labels.job_name }}
**Job Name：**{{ .Labels.job_name }}
{{- end }}

{{- if .Labels.job }}
**Prometheus Job：**{{ .Labels.job }}
{{- end -}}

{{- if .Labels.severity }}
**严重程度：**{{ .Labels.severity }}
{{- end -}}

{{- if eq .Status "firing"}}
**告警状态：**<font color='red'> {{ .Status }} </font>
**告警发生时间：**{{ .StartsAt.Format "2006-01-02 15:04:05" }}
{{- else if eq .Status "resolved" }}
**告警状态：**<font color='green'> {{ .Status }} </font>
**告警发生时间：**{{ .StartsAt.Format "2006-01-02 15:04:05" }}
**告警恢复时间：**{{ .EndsAt.Format "2006-01-02 15:04:05" }}
{{- end }}

